with open('input.txt') as file:
    result = 0

    for group in file.read().split('\n\n'):
        answers = set()
        for person in group.split():
            answers.update(person)

        result += len(answers)

print(result)